package com.huawei.appgallery.forum.user.api;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.IOpenViewAction;
import com.huawei.appgallery.forum.user.userinfo.activity.PersonalDataActivity;
import com.huawei.appgallery.foundation.ui.framework.widget.dialog.dialogactivity.DialogActivity;
import com.huawei.secure.android.common.intent.SafeIntent;
import o.cbk;
import o.ckh;
import o.dys.a;

public class OpenNickNameCheckerAction extends IOpenViewAction {
    public static final String ACTION = "open_nickname_checker_action";
    private static OnDismissListener onDismissListener;

    public OpenNickNameCheckerAction(a aVar, SafeIntent safeIntent) {
        super(aVar, safeIntent);
    }

    public void onAction() {
        cbk o_cbk = new cbk((Context) this.callback);
        o_cbk.ˎ(new ckh.a(this) {
            final /* synthetic */ OpenNickNameCheckerAction ˎ;

            {
                this.ˎ = r1;
            }

            public void ˏ(AlertDialog alertDialog, DialogActivity.a aVar, int i) {
                if (-1 == i) {
                    Intent intent = new Intent();
                    intent.setClass((Context) this.ˎ.callback, PersonalDataActivity.class);
                    if (!(this.ˎ.callback instanceof Activity)) {
                        intent.setFlags(268435456);
                    }
                    ((Activity) this.ˎ.callback).startActivity(intent);
                }
            }
        });
        o_cbk.ˏ(onDismissListener);
        o_cbk.ˊ();
    }

    public static void setOnDismissListener(OnDismissListener onDismissListener) {
        onDismissListener = onDismissListener;
    }
}
